/*
 * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The OpenAirInterface Software Alliance licenses this file to You under
 * the OAI Public License, Version 1.1  (the "License"); you may not use this file
 * except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.openairinterface.org/?page_id=698
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *-------------------------------------------------------------------------------
 * For more information about the OpenAirInterface (OAI) Software Alliance:
 *      contact@openairinterface.org
 */


#ifndef E2AP_VERIFIER_H
#define E2AP_VERIFIER_H

/* Generated by flatcc 0.6.1-dev FlatBuffers schema compiler for C by dvide.com */

#ifndef E2AP_READER_H
#include "e2ap_reader.h"
#endif
#include "flatcc/flatcc_verifier.h"
#ifndef GLOBAL_PROCEDURES_VERIFIER_H
#include "global_procedures_verifier.h"
#endif
#ifndef FUNCTIONAL_PROCEDURES_VERIFIER_H
#include "functional_procedures_verifier.h"
#endif
#include "flatcc/flatcc_prologue.h"

static int e2ap_E2Message_verify_table(flatcc_table_verifier_descriptor_t *td);

static int e2ap_Message_union_verifier(flatcc_union_verifier_descriptor_t *ud)
{
    switch (ud->type) {
    case 1: return flatcc_verify_union_table(ud, e2ap_RicSubscriptionRequest_verify_table); /* subscriptionRequest */
    case 2: return flatcc_verify_union_table(ud, e2ap_RicSubscriptionResponse_verify_table); /* subscriptionResponse */
    case 3: return flatcc_verify_union_table(ud, e2ap_RicSubscriptionFailure_verify_table); /* subscriptionFailure */
    case 4: return flatcc_verify_union_table(ud, e2ap_RicSubscriptionDeleteRequest_verify_table); /* subscriptionDeleteRequest */
    case 5: return flatcc_verify_union_table(ud, e2ap_RicSubscriptionDeleteResponse_verify_table); /* subscriptionDeleteResponse */
    case 6: return flatcc_verify_union_table(ud, e2ap_RicSubscriptionDeleteFailure_verify_table); /* subscriptionDeleteFailure */
    case 7: return flatcc_verify_union_table(ud, e2ap_RicIndication_verify_table); /* indication */
    case 8: return flatcc_verify_union_table(ud, e2ap_RicControlRequest_verify_table); /* controlRequest */
    case 9: return flatcc_verify_union_table(ud, e2ap_RicControlAcknowledge_verify_table); /* controlAcknowledge */
    case 10: return flatcc_verify_union_table(ud, e2ap_RicControlFailure_verify_table); /* controlFailure */
    case 11: return flatcc_verify_union_table(ud, e2ap_ErrorIndication_verify_table); /* errorIndication */
    case 12: return flatcc_verify_union_table(ud, e2ap_E2SetupRequest_verify_table); /* setupRequest */
    case 13: return flatcc_verify_union_table(ud, e2ap_E2SetupResponse_verify_table); /* setupResponse */
    case 14: return flatcc_verify_union_table(ud, e2ap_E2SetupFailure_verify_table); /* setupFailure */
    case 15: return flatcc_verify_union_table(ud, e2ap_ResetRequest_verify_table); /* resetRequest */
    case 16: return flatcc_verify_union_table(ud, e2ap_ResetResponse_verify_table); /* resetResponse */
    default: return flatcc_verify_ok;
    }
}

static int e2ap_E2Message_verify_table(flatcc_table_verifier_descriptor_t *td)
{
    int ret;
    if ((ret = flatcc_verify_union_field(td, 1, 0, &e2ap_Message_union_verifier) /* msg */)) return ret;
    return flatcc_verify_ok;
}

static inline int e2ap_E2Message_verify_as_root(const void *buf, size_t bufsiz)
{
    return flatcc_verify_table_as_root(buf, bufsiz, e2ap_E2Message_identifier, &e2ap_E2Message_verify_table);
}

static inline int e2ap_E2Message_verify_as_typed_root(const void *buf, size_t bufsiz)
{
    return flatcc_verify_table_as_root(buf, bufsiz, e2ap_E2Message_type_identifier, &e2ap_E2Message_verify_table);
}

static inline int e2ap_E2Message_verify_as_root_with_identifier(const void *buf, size_t bufsiz, const char *fid)
{
    return flatcc_verify_table_as_root(buf, bufsiz, fid, &e2ap_E2Message_verify_table);
}

static inline int e2ap_E2Message_verify_as_root_with_type_hash(const void *buf, size_t bufsiz, flatbuffers_thash_t thash)
{
    return flatcc_verify_table_as_typed_root(buf, bufsiz, thash, &e2ap_E2Message_verify_table);
}

#include "flatcc/flatcc_epilogue.h"
#endif /* E2AP_VERIFIER_H */
